

mod test;
mod ui;
mod test_model;
mod serivce;
mod model;
use fltk::{app, dialog, prelude::*};
use std::error::Error;
use crate::ui::home_ui::HomeUi;

fn main() {
    let app = app::App::default();

    let mut home = Box::new(ui::home_ui::HomeUi::new()) ;
    home.init();


    let result = serivce::file_service::scan_dir("D:\\CNTV");

    match result {
        Ok(root) => {
            home.render(root);
        }
        Err(e) => {
            dialog::alert_default(e.to_string().as_str());
        }
    }


    // render(root, &mut tree);

    app.run().unwrap();
}


